<template>
  <div class="EvaluteFond">
    <div class="top">
      <div class="one">宠你！懂科技的智能家电</div>
      <div class="two">
        <span class="left">共{{content.length}}篇内容</span>
        <span class="right">+关注</span>
      </div>
    </div>
    <div class="bottom"></div>
    <div class="content">
      <ul class="contentRight">
        
          <li 
          v-for="(arcitle,index) in newContent[0]" :key="index"
          >
              <router-link 
              v-bind:to="'/Evaluation/'+arcitle.id" 
              >
            <div class="imgBox">
              <img
                v-lazy="arcitle.content[0]"
                alt=""
              />
            </div>
            <div class="headline van-multi-ellipsis--l2">{{arcitle.headLine}}</div>
            <div class="usercontent">
              <span class="user">
                <img v-lazy="arcitle.userImg" alt="" />
                <span class="username">{{arcitle.userName}}</span>
              </span>
              <span class="browser">
                <span class="iconfont icon-yanjing"></span>
                {{arcitle.number}}
              </span>
            </div>
             </router-link>
          </li>
       
      </ul>
      <ul class="contentLeft">
        
          <li 
          v-for="(arcitle,index) in newContent[1]" :key="index"
          >
              <router-link v-bind:to="'/Evaluation/'+arcitle.id">
                        <div class="imgBox">
              <img
                v-lazy="arcitle.content[0]"
                alt=""
              />
            </div>
            <div class="headline van-multi-ellipsis--l2">{{arcitle.headLine}}</div>
            <div class="usercontent">
              <span class="user">
                <img v-lazy="arcitle.userImg" alt="" />
                <span class="username">{{arcitle.userName}}</span>
              </span>
              <span class="browser">
                <span class="iconfont icon-yanjing"></span>
                {{arcitle.number}}
              </span>
            </div>
             </router-link>
          </li>
       
      </ul>
    </div>
  </div>
</template>

<script>
import axios from "axios";
export default {
  name: "EvaluteFond",
  data() {
    return {
      content: [],
      newContent:[[],[]]
    };
  },
  created() {
    axios
      .get("/userShareZ", {
        method: "get",
      })
      .then((res) => {
        this.content = res.data;
        let newContent = [[],[]]
        this.content.forEach((a,index)=>{
            switch(index%2){
                case 0 :newContent[0].push(a)
                break;
                case 1 :newContent[1].push(a)
                break;
            }
        });
        this.newContent = newContent;
      })
      .catch((err) => {
        console.log(err);
      });
  }
};
//chuang
</script>

<style scoped>
.EvaluteFond {
  width: 100%;
  margin-top: 0.4rem;
}
.bottom {
  width: 100%;
  height: 2.2rem;
  background: url(https://cdn.cnbj1.fds.api.mi-img.com/mi-mall/1aadd32e226eb2569e6b3aa0953bc2af.jpg?w=1080&h=720)
    no-repeat;
  background-size: 100% 100%;
  filter: blur(5px);
  position: absolute;
  top: 0;
  z-index: -1;
}

.top {
  width: 100%;
  height: 1.6rem;
  box-sizing: border-box;
  padding: 1rem 0.1rem 0;
  color: white;
}
.one {
  font-size: 20px;
}
.two {
  display: flex;
  justify-content: space-between;
}
.right {
  display: inline-block;
  border-radius: 0.1rem;
  height: 0.22rem;
  line-height: 0.22rem;
  background-color: orange;
  padding: 0.04rem 0.1rem;
}

.content {
  width: 100%;
  background-color: rgb(242, 242, 242);
  border-radius: 0.15rem 0.15rem 0 0;
  padding: 0.1rem 0.1rem;
  display: flex;
  justify-content: space-around;
  box-sizing: border-box;
}
.content ul {
  width: 43%;
}
.content ul li {
  width: 100%;
  border-radius: 0.1rem;
  background-color: #fff;
  box-sizing: border-box;
  padding-bottom: 0.05rem;
  margin-top: .1rem;
}
.imgBox {
  width: 100%;
  border-radius: 0.1rem 0.1rem 0 0;
}
.imgBox img {
  width: 100%;
  border-radius: 0.1rem 0.1rem 0 0;
}
.headline {
  font-size: 14px;
  margin: 0.05rem 0.1rem;
}
.usercontent {
  font-size: 0.1rem;
  color: rgb(184, 179, 179);
  display: flex;
  justify-content: space-between;
  line-height: 0.3rem;
  height: .3rem;
  margin: 0 0.1rem;
}
.user img {
  width: 0.15rem;
  height: 0.15rem;
  border-radius: 50%;
}
.headline{
    color: rgb(39, 38, 38);
}
.user{
    display: flex;
    width: 70%;
    align-items: center;
}
.browser{
    display: flex;
    width: 30%;
}
</style>